package com.cake21.test.webtest.page;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.PageFactory;

import com.cake21.test.webtest.Constants;


public class Index {
	
	WebDriver driver;
	

	@FindBy(id="IDheaderlogin")
	private WebElement loginBtn;
	@FindBy(className="alert_ok")
	private WebElement popupBtn;
	
	
	public Index(WebDriver driver) {
		this.driver = driver;
		driver.get(Constants.IndexURL);
		PageFactory.initElements(driver, this);
	}
	
	public Login goLogin()
	{
		this.loginBtn.click();
		return new Login(driver);
	}
	
	public void confirmPopUpBtn()
	{
		this.popupBtn.click();
	}
	
}
